package com.sdy.healthcode.biz.dto.userpatient;

import com.sdy.healthcode.biz.model.UserPatient;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@ApiModel(value = "就诊人信息")
public class UserPatientDTO {
    @ApiModelProperty(value = "ID")
    private Integer userPatientId;
    
    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "身份证号")
    private String cardId;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "是否是本人")
    private Boolean self;

    public static UserPatientDTO fromUserPatient(UserPatient up) {
        return new UserPatientDTO()
                .setCardId(up.getCardId())
                .setName(up.getName())
                .setPhone(up.getPhone())
                .setSelf(false)
                .setUserPatientId(up.getId());
    }
}
